module.exports={
	mysql:{
		host: 'localhost',
		port: 3306,
		user: 'root',
		password: '123456',
		database: 'manage'
	},
  // 登录界面查询账号密码
	login_sql: {
		login_em_ac: 'select account from employee',
		login_em_ps: 'select password from employee where account=?',
		login_de_id: 'select departmentid from employee where account =?',
		login_sp_ac: 'select account from super_admin',
		login_sp_ps: 'select password from super_admin where account=?'
	},
	super_sql: {
		  //获取和更新管理员信息
		  per_getdata: 'select supername,tel,address,headimg from super_admin where account=?',
		  //根据account获取管理员姓名
		  per_getname: 'select supername from super_admin where account=?',
		  per_updata: 'update super_admin set supername=?,tel=?,address=?,headimg=? where account=?',
		  //更新管理员密码
		  upsuperpass: 'update super_admin set password=? where account =?'
	},
	dpt_sql: {
		// 获取所有部门信息
		dpt_getdata: 'select * from department',
		// 获取所有部门名称
		dpt_getallname: 'select dptid,dptname from department',
		// 更新部门负责人
		dpt_updptemid: 'update department set dptemid=? where dptid =?',
		//根据部门编号查询部门名称
		dpt_getname: 'select dptname from department where dptid =?',
		//添加部门
		inst_dpt: 'insert into department(dptname,dptimg,dptemid) values (?,?,?)',
		//删除部门
		dpt_delect: 'delete from department where dptid= ?',
	},
	emp_sql:{
		// 根据account获取成员的所有信息
		emp_getname: 'select empname from employee where account =?',
		//更新员工密码
		upemppass: 'update employee set password=? where account =?',
		// 根据account获取成员的所有信息
		emp_getdataby: 'select empid,empname,tel,departmentid,age,sex,address,account,headimg from employee where account =?',
		// 获取所有成员的所有信息
		emp_getdata: 'select empid,empname,tel,departmentid,age,sex,address,account,headimg from employee',
		// 获取所有成员的名称
		emp_getalldata: 'select empid,empname from employee',
		/*获取部门内所有成员名称
		*/
		dpt_getdptname: 'select empid,empname from employee where departmentid =?',
		//删除成员
		emp_delect: 'delete from employee where empid= ?',
		//添加成员
		inst_emp: 'insert into employee(empname,tel,departmentid,age,sex,address,account,password,headimg) values (?,?,?,?,?,?,?,?,?)',
		//更新成员个人信息
		dpt_updepdata :'update employee set age=?,tel=?,address=? where empid=?',
		//更新成员个人信息(more)
		updepdata :'update employee set headimg=?,empname=?,sex=?,age=?,tel=?,address=? where empid=?',
	},
	supplie_sql:{
		//查询所有供应商信息
		sup_getalldata: 'select * from supplie',
		//查询供应商的id和name
		sup_getdata: 'select id,name from supplie',
		//更新供应商信息
		sup_upsupdata: 'update supplie set linl_name=?,tel=?,address=?,email=?,bank_name=?,bank_account=?,company_location=? where id=?',
		//添加供应商信息
		inst_supdata: 'insert into supplie(name,linl_name,tel,address,email,company_location,bank_name,bank_account) values (?,?,?,?,?,?,?,?)',
		//删除供应商信息
		sup_delect: 'delete from supplie where id=?',
	},
	war_sql: {
		 // 获取仓库所有信息
		 war_getdata: 'select * from warehouse',
		 // 获取仓库名称
		 war_getname: 'select wname from warehouse',
		 //查询仓库的id和name
		 war_getonedata: 'select wid,wname from warehouse',
		 //删除仓库
		 war_delect: 'delete from warehouse where wid= ?',
		 //更新仓库信息
		 war_updata: 'update warehouse set wname=?,waremid=?,adress=?,title=? where wid=?',
		 //添加仓库信息
		 inst_wardata: 'insert into warehouse(wname,waremid,adress,title) values (?,?,?,?)',
	},
	stock_sql: {
		//获取所有商品信息
		gealltdata: 'select * from stock',
		//根据id获取商品信息
		getdata: 'select * from stock where id =?',
		//更新商品信息
		upstockdata: 'update stock set img=?,name=?,spe=?,num=?,unit=?,wid=?,alarmnum=?,production_date=?,expiration_date=?,supplier_id=?,purchase_price=?,retail_price=? where id=?',
		//根据id删除商品信息
		delstockdata: 'delete from stock where id= ?',
		//添加新商品
		stockadd: 'insert into stock(img,name,spe,num,wid,alarmnum,production_date,expiration_date,supplier_id,purchase_price,retail_price,unit) values (?,?,?,?,?,?,?,?,?,?,?,?)',
		//入库添加商品数量
		setstonum: 'update stock set num=? where id=?',
		//根据商品名称查询供应商编号
		getstoname: 'select supplier_id from stock where name=?',
		//根据商品名称和供应商名称获取仓库名称
		getwarname: 'select wid from stock where name=? and supplier_id=?',
		//根据商品名称和供应商名称和仓库名称获商品信息
		getstoid: 'select id,num from stock where name=? and supplier_id=? and wid=?',
	},
	record_sql: {
		//获取所有记录信息
		getalldata: 'select * from record',
		//根据入库员获取记录信息
		getdatabyid: 'select * from record where whentryname = (select empname from employee where account =?)',
		//根据入库员和类型获取记录信息
		databyacty: 'select * from record where type=? and whentryname = (select empname from employee where account =?)',
		//根据类型获取记录信息
		gettypedata: 'select * from record where type=?',
		//根据时间获取记录信息
		gettimedata: 'select * from record where data=?',
		//根据id获取记录信息
		getdata: 'select * from record where id =?',
		//根据id删除记录信息
		delgetdata: 'delete from record where id =?',
		//更新记录信息
		uprecorddata: 'update record set data=?,type=?,note=?,stoname=?,stospe=?,stoid=?,num=?,purchase_price=?,amount=?,supid=?,supname=?,bank_account=?,wname=?,whentryname=?,title=? where id=?',
		//添加新记录
		recadd: 'insert into record(data,type,note,stoname,stospe,stoid,num,purchase_price,amount,supid,supname,bank_account,wname,nowwar,whentryname,title) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
	},
	procure_record: {
		//根据account获取所有采购记录
		getallrecdata: 'select * from procure_record where whentryname = (select empname from employee where account =?)',
		//根据account和状态获取所有采购记录
		getrecdata: 'select * from procure_record where whentryname = (select empname from employee where account =?) and state=?',
		//根据id获取采购记录
		getrecdatabyid: 'select * from procure_record where id = ?',
		//更新记录信息
		uprecorddata: 'update procure_record set data=?,stoname=?,stoid=?,num=?,stospe=?,purchase_price=?,amount=?,supid=?,supname=?,bank_account=?,whentryname=?,title=? where id=?',
		//根据id删除记录信息
		delrecord: 'delete from procure_record where id =?',
		//添加新采购记录
		recordadd: 'insert into procure_record(state,wname,data,stoname,stoid,stospe,num,purchase_price,amount,supid,supname,bank_account,whentryname,title) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
		//获取处于初始状态的id
		getidbystate: 'select id,data from procure_record where state =?',
		//更新完成状态
		upstate: 'update procure_record set state=? where id=?',
    },
	procure_request: {
		//获取所有采购申请
		getallreqdata: 'select * from procure_request',
		 //根据whether获取采购申请
		getreqdataby: 'select * from procure_request where whether = ?',
		//根据id获取采购申请
		getreqdatabyid: 'select * from procure_request where id = ?',
		//根据操作人获取采购申请
		getreqbyname: 'select * from procure_request where whentryname = (select empname from employee where account =?)',
		//根据操作人和状态获取采购申请
		getreqbyidname: 'select * from procure_request where whether = ? and whentryname = (select empname from employee where account =?)',
		//根据id删除记录信息
		delrequest: 'delete from procure_request where id =?',
		//更新采购请求
		uprequestdata: 'update procure_request set wname=?,data=?,stoname=?,stoid=?,num=?,stospe=?,purchase_price=?,amount=?,supid=?,supname=?,bank_account=?,whentryname=?,title=? where id=?',
		//添加新采购申请
		requestadd: 'insert into procure_request(wname,data,stoname,stoid,stospe,num,purchase_price,amount,supid,supname,bank_account,whentryname,whether,title) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
		//更新完成状态
		upwhether: 'update procure_request set whether=? where id=?',
	},
	retgoods_sql: {
		//添加退货记录
		addret:'insert into retgoods(wname,data,stoname,stoid,num,stospe,purchase_price,amount,supid,supname,whentryname,title,wname)values (?,?,?,?,?,?,?,?,?,?,?,?,?,)',
		//获取所有退货记录
		getallretgoods: 'select * from retgoods',
		//根据id获取退货记录
		getretbyid: 'select * from retgoods where id =?',
		//根据id删除退货记录
		delretbyid: 'delete from retgoods where id =?',
		//根据账号获取退货记录
		getretbyacc: 'select * from retgoods where whentryname = (select empname from employee where account =?)',
		//根据完成状态获取退货记录
		getretbywea: 'select * from retgoods where whether= ? and whentryname = (select empname from employee where account =?)',
		//更新退货请求
		upret: 'update retgoods set wname=?,data=?,stoname=?,stoid=?,num=?,stospe=?,purchase_price=?,amount=?,supid=?,supname=?,whentryname=?,title=? where id=?',
	},
	state: {
		getstate: 'select * from state',
	},
	note_sql: {
		//根据类型获取所有说明
		grtnote: 'select * from note where notype=?',
	},
	swiper: {
		getallswiper: 'select * from swiper'
	},
	message: {
		getallmessage: 'select * from message',
		addmessage: 'insert into message(title,images) values (?,?)',
	}
}